--[[
Copyright:www.vxinyou.com
Author:马柏威
CreateTime:2014-12-11
Description:游戏对象类，活物对象类的父类，一般创建非活物时用该类，如特效等等
]]
local clsGameObject = Class("lua/game/clsGraphObject.lua"):Inherit()

------------------------------public------------------------------
------------------------------------------------------------------

--Function:获取前方指定距离的位置坐标
function clsGameObject:getForwardPos(distance)
	if self:isFaceLeft() == true then
        return ccpAdd(ccp(self:getPositionX(),self:getPositionY()), ccp(-distance, 0))
    else
        return ccpAdd(ccp(self:getPositionX(),self:getPositionY()), ccp(distance, 0))
	end
end

function clsGameObject:isLivingObject()
--[[	
	if self:getObjectType() == "role" or 
	   self:getObjectType() == "mainrole" or 
	   self:getObjectType() == "monster" or
	   self:getObjectType() == "pet" or 
	   self:getObjectType() == "npc" or 
	   self:getObjectType() == "statue" then
	   return true
	else
	   return false
	end
--]]
	--根据有没有状态机判断是否LivingObj
	if self.stateMachine then
		return true
	else
		return false
	end
end

function clsGameObject:getObjectType()
	return self.type == nil and "gameobject" or self.type
end

function getClass()
	return clsGameObject
end 

------------------------------private-----------------------------
------------------------------------------------------------------